<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>代码生成工具</title>
<#include "/common/resource_include.ftl">
<script src="${tdmPath}/js/common.js"></script>
<link rel="short icon" href="${tdmPath}/images/favicon.ico" type="image/x-icon"> 
<style type="text/css">
html,body{width:100%;height:100%;position:relative;overflow-y:auto;padding:0;margin:0}
body{-webkit-text-size-adjust:none; overflow-x: hidden;margin:0; padding:0;width:100%;height:100%;background:#f5f5f5;
background-image:; background-repeat:no-repeat; background-size:cover;}
#module_li{ float: left; list-style: none; line-height: 60px;width:100px;overflow: hidden;text-overflow:ellipsis;white-space: nowrap; }
#module_li a{color:#fff;text-decoration:none;}
#del_icon{color:red; display:none;text-decoration: none;}
#module_li:hover #del_icon{display:block}
#nav_bar{width:500px; margin-left:86px;}
.main-container{width:100%;height:auto;}
#addItem{width:180px;height:45px;color:#000;line-height:45px;background-color:#f5f5f5;border-bottom:2px solid #fff}
#treeView{width:180px;margin-left:0px;float:left; transition:0.3s all ease-in-out;background-color:#f5f5f5;}
#doc_panel{float:right;background:#fff;transition:0.3s all ease-in-out;}
#doc_panel_title{width:auto; height:45px;padding-top:5px;line-height:30px;}
#doc_form{transition:0.3s all ease-in-out;}
#doc_panel_content{transition:0.3s all ease-in-out;}
#main_content{transition:0.3s all ease-in-out; }
.ztree li a input.rename{height:18px;color:#000;padding-left:3px;}
#main_content::-webkit-scrollbar {
    display: none;
}
#main_content::-moz-scrollbar {
    display: none;
}
#main_content::-o-scrollbar {
    display: none;
}
#main_content{over-flow:auto}
.layui-layer-btn .layui-layer-btn0 {
    border-color: #1E9FFF;
    background-color: #27847b;
    color: #fff;
}
.ztree li a.curSelectedNode{
	height:25px;
	padding-top:5px;
}

.ztree li a{
	height:25px;
	padding-top:5px;
}
.ztree li span,.ztree li a,.ztree li span.button.ico_docu{
	vertical-align:middle;
}

.ztree li a.curSelectedNode{  color: #FFFFFF;  background: transparent;  opacity: 1;filter: alpha(opacity=100);}
.ztree li a.curSelectedNode span.node_name{background-color: #27847b!important;border-radius: 0px;color:#fff}
.layui-nav-bar{display:none}
.layui-nav{background-color:#27847b;}
.navbar-brand{height: 60px;line-height: 34px;}
.layui-nav .layui-nav-item a{text-decoration: none;}
.layui-form-checkbox[lay-skin=primary] i{margin-top:6px;}
</style>
</head>
<script src="${tdmPath}/js/common_ajax.js"></script>
<body>
	<script type="text/javascript">
		var tdmPath = "${tdmPath}";
		 var testEditor;
		//模块id
		var module_id = "";
		var module_name = "1";
		var item_id = "";
		var userId = "${(userInfor.id)!''}";
		var userName = "${(userInfor.name)!''}"
	 	var zTreeObj;
		var doc_id = "";
	</script>


	
  <div style="background: #27847b; height: 60px; width:100%;position:fixed;z-index:9999" >
 	 <div style="margin-left: 25px; float: left;margin-top:14px">
 	 		<img alt=""  src="${tdmPath}/images/logo_white.png" width="100" height="35">
 	</div> 		
	<ul class="layui-nav" style=" float: left;">
	<li class="layui-nav-item layui-this">
    <a href="${tdmPath}/code/generator.jhtml">代码生成工具</a>
    <dl class="layui-nav-child">
      <dd><a href="${tdmPath}">技术规范文档</a></dd>
    </dl>
  </li>
  </ul> 

       
 	<ul style="margin-right:30px;width:auto; float:right;height:60px;line-height:60px;"> 

       		<#if (userInfor.name)!''>
       			<li style="color:#fff;font-size: 20px;width:70px;" id="module_li">${(userInfor.name)!''}</li>	
            	<li id="module_li"  onclick="loginOut()" style="color:#fff;cursor:pointer;width:40px;" ><i class="layui-icon" style="font-size: 20px; color: #fff;">&#xe643;</i></li> 
            <#else>
           		<li id="module_li" onclick="loginUI()" style="color:#fff; cursor:pointer;"><i class="layui-icon" style="font-size: 20px; color: #fff;">&#xe612;</i></li> 
     		</#if> 
     </ul>
      
 </div>


	<!-- start 用户登录 -->
	<div class="modal fade" id="loginUI">
		<div class="modal-dialog" style="width: 350px;">
			<div class="modal-content"></div>
		</div>
	</div>
	<!-- end 用户登录 -->
	
	
	<div class="main-container" style="position:absolute;top:60px;">
	<!-- start 左侧树 -->
		<div  id="treeView" style="position:fixed">
				
				<div id="addItem" style="text-align:center">
					<a  style="cursor:pointer; text-decoration:none; color:#959fb1"><i class="layui-icon" style="font-size: 20px; ">&#xe65f;</i>&nbsp;&nbsp;菜单条目</a>&nbsp;
				</div>
				
				<div id="tree_data">
				  <ul id="permission_tree" style=" background-color: f7f7f7;"></ul> 
				  <ul id="demo"></ul>
				</div>
	</div>
	<!-- end 左侧树 -->
		
		
		
		<div id="doc_panel" style="left:180px; position: fixed;border-left:1px solid #e0e1e5;border-bottom:1px solid #e0e1e5;" >
			<div id="hide_icon"  style="float:left; background:f5f5f5; width:18px;position:fixed;" class="text-center"><a id="Test"><span id="turn_icon" class="glyphicon glyphicon-chevron-left" style="color:#5fb878;cursor:pointer;" aria-hidden="true"></span></a></div>
			<div id="main_content" style="float:left;margin-left:20px;overflow:auto;">
				<div style="width:150px; height:100px;  margin:auto;display:none;"  id="no_doc" ><img alt="" src="${tdmPath}/images/no_doc.png" width="150px;" height="100px"  style="margin:auto"></div>
			</div>
			
			<div id="return-top" style="position:absolute;z-index:999;width:50px;height:45px; right:30px;bottom:100px; background:rgba(0,0,0,0.5)" ><img alt="返回顶部" src="./images/back_top.png" style=" width:35px; height:35px; margin-top:5px;margin-left:7px;"></div> 

		</div>
   </div>  
   <script type="text/javascript">
   

   layui.use(['jquery','layer','element','form','tree'],function(){ 
     var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块
     //监听导航点击
     element.on('nav(demo)', function(elem){
       //console.log(elem)
       layer.msg(elem.text());
     });
     
     
     
   if(userName==''){
	   layui.tree({
	  	   elem: '#demo' //传入元素选择器
	  	   ,nodes: [{ //节点
	  	     name: '代码生成工具'
	  	     ,spread: true //展开
	  	     ,children: [{
	  	       name: '代码生成'
	  	       ,id:'1'//代码生成
	  	     }]
	  	   }]
	     ,click: function(node){
	    	 if(node.id!=undefined){
	    	 	managerView('/code/list.jhtml',node.id,node.name)
	    	 }
	     }  
	  	 });
   }else{
	   layui.tree({
	  	   elem: '#demo' //传入元素选择器
	  	   ,nodes: [{ //节点
	  	     name: '代码生成工具'
	  	     ,spread: true //展开
	  	     ,children: [{
	  	       name: '数据库连接管理'
	  	       ,id:'0'//数据库管理
	  	     },{
	  	       name: '代码生成'
	  	       ,id:'1'//代码生成
	  	     }]
	  	   }]
	     ,click: function(node){
	    	 if(node.id!=undefined){
	    	 	managerView('/code/list.jhtml',node.id,node.name)
	    	 }
	     }  
	  	 });
   }
    
   });
 
  
	       
   
 
   function changeSkin(){
	   if (!$('#change_skin').hasClass('dark')) {
		   testEditor.settings.editorTheme = "pastel-on-dark"
		   testEditor.settings.theme= "gray"
		   testEditor.settings.previewTheme="dark"
		   $('#change_skin').addClass('dark')
	   }else{
		   $('#change_skin').removeClass('dark') ;
		   testEditor.settings.editorTheme = "default"
		   testEditor.settings.theme= "default"
		   testEditor.settings.previewTheme="default"
	   }
		   testEditor.init("editormd");
   }
   
  $("#hide_icon").click(function(){
	  if (!$('#turn_icon').hasClass('glyphicon glyphicon-chevron-right')) {
   			$('#treeView').css('margin-left',-180)
   			$('#treeView').addClass('menu-left-back');
   			$('#turn_icon').removeClass('glyphicon glyphicon-chevron-left');
   			$('#turn_icon').addClass('glyphicon glyphicon-chevron-right');
   			
   			$('#doc_panel').css('height', $(window).height()-52);
   			$('#doc_panel').css('width', $(window).width());
   			
   			$('#doc_panel').css('margin-left', -180);
   			$('#main_content').css('width', $(window).width()-20);
   			 if(testEditor!=undefined){
   				
   			
   			if(userId==''||userId==""){
   				//testEditor.previewing();
   			}
   			testEditor.settings.width= $(window).width()-20;
   			testEditor.init("editormd");
   			}
   			 
    }else{
    	
    	$('#turn_icon').removeClass('glyphicon glyphicon-chevron-right');
		$('#turn_icon').addClass('glyphicon glyphicon-chevron-left');
    	$('#treeView').removeClass('menu-left-back');
    	$('#treeView').css('margin-left',0)
    	$('#doc_panel').css("width", $(window).width()-190);
    	$('#doc_panel').css("height", $(window).height() - 64);
    	$('#main_content').css('width', $(window).width()-220);
    	$('#doc_panel').css('margin-left',0);
    	 if(testEditor!=undefined){
    		 
    	if(userId==''||userId==""){
    			
				//testEditor.previewing();
				
			}
    	testEditor.settings.width= $(window).width()-220;
    	testEditor.init("editormd");
    	} 
    }
  });
  
  $(function(){  
	   $('#return-top').hide();  
	    $(function(){  
	    	$('#main_content').scroll(function(){  
	            if($('#main_content').scrollTop()>600){  
	                $('#return-top').fadeIn(350);  
	                }  
	                else{$('#return-top').fadeOut(350);}  
	            });  
	            $('#return-top').click(function(){  
	                  
	                $('#main_content').animate({scrollTop:0},350);  
	                return false;    
	                })  
	        })  
	      
	      
	    })  

</script>  


</body>
</html>